import { lazy } from "react";
import { TRoutes } from ".";
const Login = lazy(() => import("../containers/Login"));
const Home = lazy(() => import("../containers/Home"));
const StudyRooms = lazy(() => import("../containers/StudyRooms"));
const RoomDetails = lazy(() => import("../containers/RoomDetail"));
const PersonalCenter = lazy(() => import("../containers/PersonalCenter"));
const BookingRecord = lazy(() => import("../containers/BookingRecord"));
const Manage = lazy(() => import("../containers/Manage"));
const GeneraTerms = lazy(() => import("../containers/GeneralTerms"));
const Notification = lazy(() => import("../containers/Notification"));
const RoomManagement = lazy(() => import("../containers/RoomManagement"));
const AnnouncementManagement = lazy(
  () => import("../containers/AnnouncementManagement")
);
const UserSignManagement = lazy(
  () => import("../containers/UserSignManagement")
);
export const routes: TRoutes[] = [
  {
    path: "",
    name: "login",
    element: <Login />,
  },
  {
    path: "/Home",
    name: "home",
    element: <Home />,
  },
  {
    path: "/StudyRooms",
    name: "studyrooms",
    element: <StudyRooms />,
  },
  {
    path: "/RoomDetails",
    name: "studyrooms",
    element: <RoomDetails />,
  },
  {
    path: "/PersonalCenter",
    name: "personalCenter",
    element: <PersonalCenter />,
  },
  {
    path: "/BookingRecord",
    name: "bookingRecord",
    element: <BookingRecord />,
  },
  {
    path: "/Manage",
    name: "manage",
    element: <Manage />,
    children: [
      {
        path: "",
        name: "generaTerms",
        element: <GeneraTerms />,
      },
      {
        path: "RoomManagement",
        name: "roomManagement",
        element: <RoomManagement />,
      },
      {
        path: "AnnouncementManagement",
        name: "announcementManagement",
        element: <AnnouncementManagement />,
      },
      {
        path: "UserSignManagement",
        name: "userSignManagement",
        element: <UserSignManagement />,
      },
    ],
  },
  {
    path: "/Notification",
    name: "notification",
    element: <Notification />,
  },
  {
    path: "*",
    name: "404",
    element: <h1>404</h1>,
  },
];
